package club.hicode.daydayup.kafka;

import cn.hutool.json.JSONUtil;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * Kafka的接收消息
 *
 * @author Liu Chunfu
 * @date 2018-07-25 上午10:43
 **/
@Component
public class KafkaReceiver {

    @KafkaListener(topics = "test1")
    public void processMessage(String content) {
        MicMessage m = JSONUtil.toBean(content, MicMessage.class);
        System.out.println(m);
    }
}
